package com.mybatis.main;

import com.mybatis.entity.User;
import com.mybatis.mapper.UserMapper;
import com.mybatis.utils.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.Logger;

/**
 * @author qinjiasheng
 */
public class Chapter4Main {
	public static void main(String[] args) {
		Logger logger = Logger.getLogger(Chapter4Main.class);
		SqlSession sqlSession = SqlSessionFactoryUtils.openSqlSession();
		UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
		User user = userMapper.getUser(1L);
		logger.info("性别=="+user.getSex().getName());
		logger.info("用户=="+user);
	}
}
